#include "AiboState.h"

AiboState::AiboState()
{
    m_forward = false;
    m_strafe  = false;
    m_turn    = false;
    m_roll    = false;
    m_pan     = false;
    m_tilt    = false;
}

AiboState::~AiboState()
{
}

void AiboState::startForward(float speed)
{
	qDebug() << "AiboState: Forward Request - " << speed;
    m_forward = true;
    m_forwardSpeed = speed;
}

void AiboState::startStrafe(float speed)
{
	qDebug() << "AiboState: Strafe Request - " << speed;
    m_strafe = true;
    m_strafeSpeed = speed;
}

void AiboState::startTurning(float speed)
{
	qDebug() << "AiboState: Turn Request - " << speed;
    m_turn = true;
    m_turnSpeed = speed;
}

void AiboState::stopForward()
{
	qDebug() << "AiboState: Stop Forward Request";
    m_forward = false;
}

void AiboState::stopStrafe()
{
	qDebug() << "AiboState: Stop Strafe Request";
    m_strafe = false;
}

void AiboState::stopTurning()
{
	qDebug() << "AiboState: Stop Turn Request";
    m_turn = false;
}

bool AiboState::isWalkInstructionOn() 
{
	return isForward() || isStrafe() || isTurning();
}

bool AiboState::isForward()
{
    return m_forward;
}

bool AiboState::isStrafe()
{
    return m_strafe;
}

bool AiboState::isTurning()
{
    return m_turn;
}

void AiboState::setRoll(float roll)
{
	qDebug() << "AiboState: Roll Request - " << roll;
    m_roll = true;
    m_rollValue = roll;
}

void AiboState::setPan(float pan)
{
	qDebug() << "AiboState: Pan Request - " << pan;
    m_pan = true;
    m_panValue = pan;
}

void AiboState::setTilt(float tilt)
{
	qDebug() << "AiboState: Tilt Request - " << tilt;
    m_tilt = true;
    m_tiltValue = tilt;
}

void AiboState::stopRoll() {
	qDebug() << "AiboState: Stop Roll Request";
	this->m_roll = false;
}

void AiboState::stopPan() {
	qDebug() << "AiboState: Stop Pan Request";
	this->m_pan = false;
}

void AiboState::stopTilt() {
	qDebug() << "AiboState: Stop Tilt Request";
	this->m_tilt = false;
}

float AiboState::getRoll()
{
    return m_rollValue;
}

float AiboState::getPan()
{
    return m_panValue;
}

float AiboState::getTilt()
{
    return m_tiltValue;
}

bool AiboState::isHeadInstructionOn() {
	return isRolling() || isPanning() || isTilting();
}

bool AiboState::isRolling() {
	return m_roll;
}

bool AiboState::isPanning() {
	return m_pan;
}

bool AiboState::isTilting() {
	return m_tilt;
}
